package com.ucarbon.ucarbon.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ucarbon.ucarbon.service.IYearsService;
import com.ucarbon.ucarbon.utils.RespBean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;


/**
 * <p>
 * 年份信息 前端控制器
 * </p>
 *
 * @author XuGaoran
 * @since 2024-01-04
 */
@RestController
@RequestMapping("/ucarbon/years")
public class YearsController {

    @Autowired
    private IYearsService yearsService;

    @GetMapping("/all")
    public RespBean getAllYear() {
        try {
            return RespBean.success("封装成功", yearsService.listMaps());
        } catch (Exception e) {
            return RespBean.error("封装失败", e);
        }
    }
    
}
